/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.server.modules.sys.entity.valicode;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.server.common.persistence.DataEntity;

/**
 * 验证码Entity
 * @author 颜洪毅
 * @version 2016-08-15
 */
public class ValiCode extends DataEntity<ValiCode> {
	
	private static final long serialVersionUID = 1L;
	private String telephone;		// telephone
	private String sentCode;		// sent_code
	private Date sentTime;		// sent_time
	private String clientIp;		// client_ip
	
	public ValiCode() {
		super();
	}

	public ValiCode(String id){
		super(id);
	}

	@Length(min=1, max=11, message="telephone长度必须介于 1 和 11 之间")
	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	
	@Length(min=1, max=6, message="sent_code长度必须介于 1 和 6 之间")
	public String getSentCode() {
		return sentCode;
	}

	public void setSentCode(String sentCode) {
		this.sentCode = sentCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="sent_time不能为空")
	public Date getSentTime() {
		return sentTime;
	}

	public void setSentTime(Date sentTime) {
		this.sentTime = sentTime;
	}
	
	@Length(min=1, max=50, message="client_ip长度必须介于 1 和 50 之间")
	public String getClientIp() {
		return clientIp;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}
	
}